#! /bin/sh
DIR=$(dirname "$0")
if [ -z "$PYTHON" ]
then
  ARGS=$(getopt 23 "$*" 2> /dev/null)
  for arg in $ARGS
  do
    case $arg
    in
      -2) PYTHON=python2; shift;;
      -3) PYTHON=python3; shift;;
      --) PYTHON=python3; break;;
    esac
  done
fi
$PYTHON --version > /dev/null 2>&1
if [ ! $? -eq 0 ]
then
  echo "WARNING: '$PYTHON' not found, using 'python' instead."
  PYTHON=python
fi
PYTHONPATH=$DIR exec "$PYTHON" -m scapy "$@"
